<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/css/style.css" type="text/css" media="all" />
<script src="<?php echo URL::base() ?>media/js/jquery-1.10.1.min.js"></script>

<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css" media="all" />
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>	 

<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>

<script type="text/javascript">

$(document).ready(function(){
	
	$.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' });
	$(".datepicker").datepicker();
	
	});
</script>

<form action="<?php echo url::base(true)?>purchases/improper" method="get">
采购单时间
从：<input type="text" class="input-medium datepicker" name="purchaseorder_date_from"
value="<?php if(isset($GET['purchaseorder_date_from'])) echo $GET['purchaseorder_date_from'] ?>">
到：<input type="text" class="input-medium datepicker" name="purchaseorder_date_to"
value="<?php if($GET['purchaseorder_date_to'])echo $GET['purchaseorder_date_to']?>">
采购单号<input type="text" class="input-medium" name="purchaseordes_id" value="<?php if($GET['purchaseordes_id'])echo $GET['purchaseordes_id']?>">
采购人员<input type="text" class="input-medium" name="purchase_name" value="<?php if($GET['purchase_name'])echo $GET['purchase_name']?>">
供应商<input type="text" class="input-medium" name="supplier_name" value="<?php if($GET['supplier_name'])echo $GET['supplier_name']?>">
<input type="submit" value="查询" class="btn btn-info">

</form>
<?php if(isset($purchaseorders_lists) and $purchaseorders_lists)
{?>
<table class="table table-bordered">
<tr>
<th>采购单号
</th>
<th>采购人员
</th>
<th>采购单时间
</th>
<th>供应商
</th>

</tr>
<?php foreach ($purchaseorders_lists as $purchaseorders){?>
<tr>
<td><?php echo $purchaseorders['purchaseordersid']?>
</td>
<td><?php $purchase_id = ORM::factory('user',$purchaseorders['purchase_id']);
if($purchase_id->loaded())
{
echo $purchase_id->name;
}?>
</td>
<td><?php echo $purchaseorders['purchaseorder_date']?>
</td>
<td>
<?php
//--------------------------------------kdw--------------------------------------
//$supplier_id = Service_warning::get_provider_by_id($purchaseorders['supplier_id']);
$supplier_id=Service_warning::get_provider_by_id($purchaseorders['purchaseordersid']);
//---------------------------------------kdw-end---------------------------------
if($supplier_id)
{
	echo $supplier_id['vProviderName'];
}
?></td>
</tr>
<?php }?>
</table>
<?php if(isset($pagination))echo $pagination;?>
<?php }?>